package pattern12.overtime;

/**
 * 下午的工作状态
 * @author wdl
 */
public class AfternoonState implements IState {
    @Override
    public void writeProgram(Work work) {
        if (work.getHour()<17){
            System.out.println("当前时间"+work.getHour()+",下午状态不错，继续努力");
        }else {
            //不满足条件就切换到下一个状态
            work.setState(new EveningState());
            work.writeProgram();
        }
    }
}
